home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / x10_xa04.zip / XA.CMD < prev    next >
OS/2 REXX Batch file  |  1991-08-03  |  10KB  |  263 lines

  1. #
  2. #  ┌─────────────────────────────────────────────────────────────────┐
  3. #  │                                                                 │
  4. #  │   XA - X10 Command Interpreter for the CP-290 - Version 1.04    │
  5. #  │   Copyright 1991 by Bruce Christensen. All Rights Reserved.     │
  6. #  │                                                                 │
  7. #  └─────────────────────────────────────────────────────────────────┘
  8. #
  9. #──────────────────────────────────────────────────────────────────────────────
  10. #
  11. #
  12. #    IF NONE OF THIS MAKES SENSE....
  13. #                                   ....READ THE MANUAL (XA.TXT)
  14. #
  15. #
  16. #──────────────────────────────────────────────────────────────────────────────
  17. #
  18. # <--This denotes the beginning of a comment. It is only recognized
  19. #    when it appears as the first character in a line
  20.  
  21. # ^--Blank lines are also ignored.
  22. #
  23. #──────────────────────────────────────────────────────────────────────────────
  24. #
  25. #    The next token (ERASE) will remove all events from the CP-290
  26. #    memory. You are advised to use this when you use the DATE token for
  27. #    programming specific events. This ensures that when the event has
  28. #    passed, it will be deleted. Since every one of your events should
  29. #    be included in this file, there is no need to worry about erasing them
  30. #    now...they will be downloaded automatically.
  31.  
  32. ERASE
  33.  
  34. #
  35. #──────────────────────────────────────────────────────────────────────────────
  36. #
  37. #    PORT                The serial communications port you will be using
  38. #                        to talk to the computer interface.
  39. #                        Choices: COM1 (default), COM2, COM3, and COM4.
  40.  
  41. PORT COM1
  42.  
  43. #
  44. #──────────────────────────────────────────────────────────────────────────────
  45. #
  46. #    DEFINES can be used to substitute several identifiers. They help
  47. #    make the commands more understandable.
  48. #    For instance, you define COMPUTER as HOUSE A UNIT 8 as follows:
  49. #
  50.  
  51. DEFINE OUTSIDE_LIGHTS HOUSE A UNIT 1 
  52. DEFINE LIVING_ROOM_LAMP HOUSE A UNIT 2
  53. DEFINE BEDROOM_LIGHT HOUSE A UNIT 3 
  54. DEFINE FAMILY_ROOM_LAMP HOUSE A UNIT 4
  55. DEFINE FLAG HOUSE A UNIT 5
  56. DEFINE COMPUTER A8 
  57. DEFINE DUSK SUNSET OFFSET 10
  58. DEFINE DAWN OFFSET -30
  59.  
  60. #    The following DEFINES were commented out:
  61. #
  62. #define xmas_computer house a unit 7 
  63. #define red house k unit 1                      
  64. #define green house k unit 2 
  65. #define blue house l unit 1
  66. #define white house l unit 2   
  67.  
  68. #    DEFINES must be declared before they are used in this file.
  69. #
  70. #──────────────────────────────────────────────────────────────────────────────
  71. #
  72. #    The following are direct commands that are performed
  73. #    as soon as they are parsed (they are commented out).
  74. #
  75.  
  76. #HOUSE A UNIT 2 OFF
  77. #FAMILY_ROOM_LAMP ON
  78.  
  79. #
  80. #──────────────────────────────────────────────────────────────────────────────
  81. #
  82. #    LATITUDE            You must use this command for accurate
  83. #                        sunrise/sunset calculations. Positive values
  84. #                        are used in the northern hemisphere, negative
  85. #                        values for the southern hemisphere.
  86. #    LONGITUDE           You must use this command for accurate
  87. #                        sunrise/sunset calculations. Positive values
  88. #                        are used west of Greenwich, negative
  89. #                        east of Greenwich.
  90. #                        These values may be obtained from almost any
  91. #                        almanac, or consult your nearest library.
  92. #                        For Mentor, OH:
  93. #                             Latitude  = 41°35'
  94. #                             Longitude = 81°20'
  95. #                        
  96. #                        These values must be expressed as follows:
  97. #                             41d35m and 81d20m (or 41°35' / 81°20')
  98.  
  99. LATITUDE  41°35'
  100. LONGITUDE 81°20'
  101.  
  102. #
  103. #──────────────────────────────────────────────────────────────────────────────
  104. #
  105. #    TIMEZONE            Exact time calculations depend on the local time.
  106. #                        Use the following chart to determine your timezone:
  107. #                                  Zone                   Use
  108. #                             ====================     =========
  109. #                             Eastern Standard Time:        5
  110. #                             Eastern Daylight Time:        4
  111. #                             Central Standard Time:        6
  112. #                             Central Daylight Time:        5
  113. #                             Mountain Standard Time:       7
  114. #                             Mountain Daylight Time:       6
  115. #                             Pacific Standard Time:        8
  116. #                             Pacific Daylight Time:        7
  117. #
  118.  
  119. TIMEZONE 4
  120.  
  121. #
  122. #──────────────────────────────────────────────────────────────────────────────
  123. #
  124. #    Set the X10 clock to the time and date of your PC's internal clock.
  125. #    Use the optional "EXACT" token to wait for the seconds counter to
  126. #    rollover to 0.
  127.  
  128. SYNCHRONIZE X10 EXACT
  129.  
  130. #
  131. #──────────────────────────────────────────────────────────────────────────────
  132. #
  133. #    Set the PC clock to the time of your X10's internal clock.
  134. #    Use the optional "EXACT" token to wait for the seconds counter to
  135. #    rollover to 0.
  136. #
  137. #    Note: There is not enough information from the X10 to set the date.
  138.  
  139. #SYNCHRONIZE PC
  140.  
  141.  
  142. #
  143. #──────────────────────────────────────────────────────────────────────────────
  144. #
  145. #    The following events will be downloaded to the CP-290 approximately
  146. #    one week before they are scheduled to occur (providing you run XA.EXE
  147. #    every week for updates). They turn on lights for the flag every evening
  148. #    on July 4, and off at sunrise on July 5 (every year). See the 
  149. #    documentation for more information.
  150.  
  151. DATE 7/4/ FLAG ON SUNSET
  152. DATE 7/5/ FLAG OFF SUNRISE 
  153.  
  154. #
  155. #──────────────────────────────────────────────────────────────────────────────
  156. #
  157. #    The following are a set of commands that are downloaded weekly. See the
  158. #    documentation for full details - but here's a synopsis:
  159. #    Every Sunday morning at 3:00, the computer is turned on via X10. As
  160. #    DOS executes AUTOEXEC.BAT, a utility supplied with this package,
  161. #    POWERUP.EXE will return an ERRORLEVEL of 1 if the current time is
  162. #    within a range that you specify. This errorlevel can then be used to 
  163. #    invoke XA.EXE to download another weeks worth of events, or you can use
  164. #    it to call other programs as well, for instance: backup programs, 
  165. #    communications, etc. See the documentation for more details.
  166. #    
  167. #    Note the use of the SUNRISE and SUNSET tokens. These tokens will 
  168. #    calculate the exact time of sunrise or sunset for your city assuming 
  169. #    LATITUDE, LONGITUDE, and TIMEZONE were all entered correctly. 
  170. #    This avoids having to constantly enter a new time for your outdoor lights.
  171.  
  172. SUNDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
  173. SUN OFF SUNRISE OUTSIDE_LIGHTS
  174. SUNDAY ON DUSK LIVING_ROOM_LAMP
  175. SUNDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  176. SUNDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  177. SUNDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
  178.  
  179. MONDAY ON SUNSET OUTSIDE_LIGHTS DIM 90   
  180. MON OFF SUNRISE OUTSIDE_LIGHTS
  181. MONDAY ON DUSK LIVING_ROOM_LAMP 
  182. MONDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  183. MONDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP 
  184. MONDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
  185.  
  186. TUESDAY ON SUNSET OUTSIDE_LIGHTS DIM 90  
  187. TUE OFF SUNRISE OUTSIDE_LIGHTS
  188. TUESDAY ON DUSK LIVING_ROOM_LAMP
  189. TUESDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  190. TUESDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  191. TUESDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
  192.  
  193. WEDNESDAY ON SUNSET OUTSIDE_LIGHTS DIM 90 
  194. WED OFF SUNRISE OUTSIDE_LIGHTS
  195. WEDNESDAY ON DUSK LIVING_ROOM_LAMP
  196. WEDNESDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  197. WEDNESDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  198. WEDNESDAY OFF TIME 11:30 PM FAMILY_ROOM_LAMP
  199.  
  200. THU ON SUNSET OUTSIDE_LIGHTS DIM 90 
  201. THURSDAY OFF SUNRISE OUTSIDE_LIGHTS
  202. THURSDAY ON DUSK LIVING_ROOM_LAMP
  203. THURSDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  204. THURSDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  205. THURSDAY OFF  TIME 11:30 PM FAMILY_ROOM_LAMP
  206.  
  207. FRIDAY ON SUNSET OUTSIDE_LIGHTS DIM 90
  208. FRI OFF SUNRISE OUTSIDE_LIGHTS
  209. FRIDAY ON DUSK LIVING_ROOM_LAMP
  210. FRIDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  211. FRIDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  212. SATURDAY OFF TIME 12:30 AM FAMILY_ROOM_LAMP
  213.  
  214. SATURDAY ON SUNSET OUTSIDE_LIGHTS DIM 90  
  215. SAT OFF SUNRISE OUTSIDE_LIGHTS
  216. SATURDAY ON DUSK LIVING_ROOM_LAMP
  217. SATURDAY OFF TIME 11:30 PM LIVING_ROOM_LAMP
  218. SATURDAY ON SUNSET OFFSET -60 FAMILY_ROOM_LAMP
  219. SUNDAY OFF TIME 12:30 AM FAMILY_ROOM_LAMP
  220.  
  221. #EVERYDAY ON TIME 5:45 AM OUTSIDE_LIGHTS DIM 90
  222. EVERYDAY OFF SECURITY TIME 12:30 AM OUTSIDE_LIGHTS
  223.  
  224. EVERYDAY ON  TIME 10:55 PM BEDROOM_LIGHT 
  225. EVERYDAY OFF SECURITY TIME 1:30 AM BEDROOM_LIGHT
  226.  
  227. # The following turns on the Christmas lights at 15 minutes after sunset.
  228. #
  229. # EVERYDAY ON SUNSET OFFSET 15 XMAS_COMPUTER  EVENT 25
  230. # EVERYDAY OFF TIME 11:20 PM  XMAS_COMPUTER EVENT 26
  231. # EVERYDAY OFF TIME 11:21 PM  RED EVENT 21
  232. # EVERYDAY OFF TIME 11:21 PM  GREEN EVENT 22
  233. # EVERYDAY OFF TIME 11:21 PM  BLUE EVENT 23
  234. # EVERYDAY OFF TIME 11:21 PM  WHITE EVENT 24
  235.  
  236. #
  237. #──────────────────────────────────────────────────────────────────────────────
  238. #
  239. #    The following event occurs every Sunday at 3:00 AM.
  240. #    When used in conjuction with POWERUP.EXE (in AUTOEXEC.BAT)
  241. #    we can automatically download new commands an a weekly basis.
  242. #    For example, sunrise and sunset change from day to day. The X10
  243. #    computer interface can store these times for 1 week, then it
  244. #    needs to be updated with new times.
  245. #
  246. #    Additional note: Backups are now performed during this time, as
  247. #         well as having all the drives optimized. See the sample 
  248. #         AUTOEXEC.BAT file supplied with this package.
  249.  
  250. SUNDAY ON COMPUTER TIME 3:00 AM
  251.  
  252. #    Note: The sample AUTOEXEC.BAT contains the command: XA "A8 OFF"
  253. #    after the download, optimizations, and backups have been performed.
  254. #    But just in case something went wrong (like leaving a floppy in Drive A),
  255. #    we'll have the CP-290 turn the computer off 30 minutes later.
  256.  
  257. SUNDAY OFF COMPUTER TIME 3:30 AM
  258.  
  259.  
  260.  
  261.  
  262. # That's all folks.
  263.